package com.ytjj.quartz.task;

import com.ytjj.qmyx.users.client.AdminClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 *
 * @version 1.0
 *
 */

@Component
@Slf4j
public class DataAnalyseTask {
    @Resource
    private AdminClient adminClient;

    /**
     * 每天凌晨一点统计分析
     */
//    @Scheduled(cron = "0 0 1 * * ?")
//    @Async
    public void dataAnalyseStatistics() {
        adminClient.timing(null);
        log.info("数据分析统计中 --- ");
    }

    /**
     * 15分钟一次当天统计分析
     */
//    @Scheduled(cron = "0 0/15 * * * ?")
//    @Async
    public void dataAnalyseStatisticsMin() {
        adminClient.timing(LocalDate.now());
        log.info("数据分析统计中 --- ");
    }

}
